package com.java.simple.study.juc.p3;

/**
 * @author zhoujl
 * @date 2022/5/9 21:34
 * @desc
 */
public class Test {
    public static void main(String[] args) throws InterruptedException {
        Thread t1 = new Thread(() -> {
            synchronized (Test.class) {
                try {
                    Thread.sleep(10000);
                } catch (InterruptedException e) {
                    e.printStackTrace();
                }
            }
        }, "t1");
        t1.start();

        Thread.sleep(100);
        Thread t2 = new Thread(() -> {
            synchronized (Test.class) {

            }
        }, "t2");
        t2.start();

        Thread t3 = new Thread(() -> {
            synchronized (Test.class) {

            }
        }, "t3");
        t3.start();
        // TIMED_WAITING
        System.out.println(t1.getState());
        // BLOCKED
        System.out.println(t2.getState());
        // BLOCKED
        System.out.println(t3.getState());

    }


}
